#include "stdfx.h"

#include "frame.h"
#include "player.h"
#include "match.h"
#include "player_bonus.h"
#include "pin_scheme.h"
#include "turn.h"

#include "frame_controller.h"

//#include <boost/asio.hpp>

//#include <stdexcept>
//#include <boost/test/included/prg_exec_monitor.hpp>
//#include <boost/test/minimal.hpp>

#define USE_UNIT_TESTING

#ifndef USE_UNIT_TESTING


void frameUpdateEvent(bool result)
{
    std::cout << "frameUpdateEvent " << result << std::endl;
}

int main(int argc, const char** argv) try
{
    auto& controller = FrameController::getInstance();
    
//    controller.onUpdateFrame(&frameUpdateEvent);
//    controller.onUpdateFrame([](bool result){ std::cout << "lambda fire! " << result << std::endl; });
    
    controller.updateFrameReq();
    controller.onTurn([](const PinScheme&) 
    { 
        std::cout << "turn was made\n";  
    });
    
    controller.simulateTurn("1111111111");

    return 0;
}
catch(std::exception& e)
{
    std::cout << "exeption!!! " << e.what() << std::endl;
}
catch( ... )
{
    std::cout << "exeption!!! ... " << std::endl;
}
#else
#include "tests/tests.h"
#endif
